{% extends 'base.html' %}
{% load format %}
{% block extra-head %}
<style type="text/css">
/* parent container in which this page fits */
table.container td.info {
  padding: 0;
  height: 200px;
}
</style>
{% endblock %}

{% block nav-title %}
My Activities
{% endblock %}
{% block nav-home-class %}
selected
{%endblock%}
{% block content %}

<div id="home">
  <div id='learning'>
  <h3>Enrolled</h3>
  <table>
    <tr>
      <th>Title</th>
      <th>Date</th>
      <th>Time</th>
      <th>Location</th>
      <th>Status</th>
    {% for activity in learning_activities %}
      <tr>
        <td>
          <a href={% url ShowActivity activity_key=activity.key %}>{{ activity.program_name }}</a><br />
        </td>
        <td>
        {% for schedule in activity.sorted_schedules %}
          {{ schedule.start_time_local|weekday }} {{ schedule.start_time_local|format_date }}<br />
        {% endfor %}
        </td>
        <td>
          {% for schedule in activity.sorted_schedules %}
            {{ schedule.start_time_local|format_time }} - {{ schedule.end_time_local|format_time }} {{ schedule.start_time_local|timezone }}
            {% if schedule.notes %}
              <img src="/images/notes.gif" title="{{ schedule.notes }}" alt="notes" />
            {% endif %}
            <br />
          {% endfor %}
        </td>
        <td>
          {% for schedule in activity.sorted_schedules %}
            {% if schedule.access_points or schedule.access_points_secondary %}
              {{ schedule.selected_location }}
            {% else %}
              N/A
            {% endif %}
            <br />
          {% endfor %}
        </td>
        <td>
          {% if activity.user_register_status %}
            <span class="status">{{ activity.user_register_status }}</span>
          {% endif %}
          {% if activity.register_status_reason %}
            <img id="id_status_reason" class="note" src="/images/question_mark.gif"
             title="{{ activity.register_status_reason }}" alt="reasons"/>
          {% endif %}
          {% if activity.waitlist_rank_info %}
            <br/><div class="roster_number_info">({{ activity.waitlist_rank_info }})</div>
          {% endif %}
        </td>
      </tr>
    {% endfor %}
  </table>
  {% if more_learning %}
    <a href="{% url ShowLearning %}">More &raquo;</a>
  {% endif %}
  </div>
  
  <div id='teaching'>
  <h3>Teaching</h3>
  <table>
    <tr>
      <th>Title</th>
      <th>Date</th>
      <th>Time</th>
      <th>Location</th>
    </tr>
    {% for activity in teaching_activities %}
     <tr>
      <td>
         <a href={% url ShowActivity activity_key=activity.key %}>{{ activity.program_name }}</a><br />
      </td>
      <td>{% for schedule in activity.sorted_schedules %}
          {{ schedule.start_time_local|weekday }} {{ schedule.start_time_local|format_date }}<br />
        {% endfor %}
      </td>
      <td>
          {% for schedule in activity.sorted_schedules %}
            {{ schedule.start_time_local|format_time }} - {{ schedule.end_time_local|format_time }} {{ schedule.start_time_local|timezone }}
            {% if schedule.notes %}
              <img src="/images/notes.gif" title="{{ schedule.notes }}" alt="notes" />
            {% endif %}
            <br />
          {% endfor %}
      </td> 
      <td>
      {% for location in activity.locations %}
        {{ location }}{% if not forloop.last %},{% endif %}
      {% endfor %}
      {% if activity.locations_secondary %}
      <br/>
      <a title='Show secondary locations' id="less_locations_{{forloop.parentloop.counter}}_{{forloop.counter}}" onClick="javascript:dialog.displayRooms('{{forloop.parentloop.counter}}_{{forloop.counter}}', true);" href='#'>
      <span class="bold">{{ activity.locations_secondary|length }}</span> more &raquo;</a>
      <div id='more_locations_{{forloop.parentloop.counter}}_{{forloop.counter}}' class='hidden'>
      {% for location in activity.locations_secondary %}
        {{ location }}{% if not forloop.last %},{% endif %}
      {% endfor %}
      <br/>
      <a href="#" onClick="javascript:dialog.displayRooms('{{forloop.parentloop.counter}}_{{forloop.counter}}', false);">
      &laquo; show less</a>
      </div>
      {% endif %}
      </td>
    </tr>
    {% endfor %}
  </table>
  {% if more_teaching %}
    <a href="{% url ShowTeaching %}">More &raquo;</a>
  {% endif %}
  </div>
  
  <div id='owned'>
  <h3>Managing</h3>
  <table>
    <tr>
      <th>Title</th>
    </tr>
    {% for program in owned_programs %}
    <tr>
      <td>
        <a href="{% url ShowProgram program_key=program.key %}"> {{program.name }}</a>
      </td>
    </tr>
    {% endfor %}
  </table>
  {% if more_owned %}
    <a href="{% url ShowOwned %}">More &raquo;</a>
  {% endif %}
  </div>
  
</div>
{% endblock %}
<!--
Copyright 2010 Google Inc. All Rights Reserved.

Use of this source code is governed by an Apache 2.0 License.
See the COPYING file for details.
-->
